package com.passer.labyrinth.core.util;

import java.awt.*;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

public class ImgUtils {

    public static List<Image> getLocalImg() {
        List<Image> imgList = new ArrayList<>();
        URL imgUrl = ImgUtils.class.getClassLoader().getResource("img");
        if (imgUrl == null) {
            System.out.println("错误：图片文件未找到！");
            return imgList;
        }
        String imgPath = imgUrl.getPath() + File.separator;
        for(int i=0;i<20;i++){
            imgList.add(Toolkit.getDefaultToolkit().getImage(imgPath + "pic"+i+".png"));
        }
        return imgList;
    }
}
